﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Autodesk.Revit.UI;

namespace YJKAxisAndEdit
{
	public partial class SortAxisForm : System.Windows.Forms.Form
	{
		public string NewName { get; set; }

		public SortAxisForm(ExternalCommandData cmdData)
		{
			this.m_Revit = cmdData;
			this.InitializeComponent();
		}

		private void btOk_Click(object sender, EventArgs e)
		{
			this.NewName = this.tbStartName.Text;
		}

		private void SortAxisForm_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (((Form)sender).DialogResult == DialogResult.OK)
			{
				string text = this.tbStartName.Text;
				string text2 = "";
				if (!AxisNameManager.IsValidatingOfName(text, true, ref text2))
				{
					MessageBox.Show(text2, "盈建科提示");
					e.Cancel = true;
				}
			}
		}

		private ExternalCommandData m_Revit;
	}
}
